//保存表单配置
export const GROUPS = ['detail', 'add', 'update'] as const;

export type Group = typeof GROUPS[number];

export class SaveFormConfig {
    label?: string;//label
    prop?: string;//字段
    width?: string = '90%'//列宽占比 默认90%
    placeholder?: string = ''
    customSlotName: string = "" //自定义插槽配置
    group?: Group[] = ['detail', 'add', 'update'] //配置项分组 默认全部 可选detail add update 分别表示
    title?: string = "不可编辑"

    buildLabel(label: string): this {
        this.label = label
        return this
    }

    buildProp(prop: string): this {
        this.prop = prop
        return this
    }

    buildWidth(width: string): this {
        this.width = width
        return this
    }

    buildPlaceholder(placeholder: string) {
        this.placeholder = placeholder
        return this
    }

    buildCustomSlotName(customSlotName: string): this {

        this.customSlotName = customSlotName
        return this
    }

    buildGroup(group: Group[]): this {
        this.group = group
        return this
    }

    buildTitle(title: string): this {
        this.title = title
        return this
    }
}